import {createRouter,createWebHashHistory} from 'vue-router'
import list from '../components/list.vue'
import detail from '../components/detail.vue'


let router = createRouter({
    history:createWebHashHistory(),
    routes:[
        {
            path:"/",
            redirect:"/list" //重定向 
            
        }
        ,
        {
            path:"/list",
            //component: list -> 默认路由  router-view 没有name
            components:{
                // 路由名称 ：组件对象
                listView:list,
                detailView:list
                //default:list 默认视图
            }
        },
        {
            path:"/detail",
            components:{
                detailView:detail
            }
        }

    ]
})

export default router;